<?php
declare (strict_types=1);

namespace app\listener\agent;

use app\event\ChangePageSettingSuccess;
use app\model\PageSetting;
use think\facade\Cache;

class ResetCache
{
    /**
     * 事件监听处理
     * @param ChangePageSettingSuccess $event
     * @return mixed
     */
    public function handle(ChangePageSettingSuccess $event)
    {
        /**
         * @var PageSetting $pageSetting
         */
        $pageSetting = $event->pageSetting;
        $agent_id = $pageSetting->agent_id;
        $type = $pageSetting->type;
        $sub_category = $pageSetting->sub_category;
        $cache_key = 'JumpTypeService_getJumpConfig_page_setting_key_cache_'.$agent_id.'_'.$type.'_'.$sub_category;
        Cache::set($cache_key, NULL);
        //file_put_contents('100.txt',$cache_key,FILE_APPEND);
    }
}
